#include "CalServer.hpp"
#include <memory>

using tcps::USAGE;

void Usage(std::string proc)
{
    std::cout << "\nUsage:\n\t" << proc << "\tlocalport\n" <<std::endl;
    exit(USAGE);
}

int main(int argc, char* argv[])
{
    if(argc < 2)
    {
        Usage(argv[0]);
    }

    uint16_t serverport = atoi(argv[1]);
    std::unique_ptr<tcps::CalServer> ctcpsvr(new tcps::CalServer(serverport));
    ctcpsvr->initCalServer();
    ctcpsvr->runCalServer(cal);

    return 0;
}